<?php
class display
{
	function navBar($Login)
	{
		?><div id=navbar>
		<span id=logo>
			Twicha
			"Easy Enough"
		</span> 		
		<span id=top_links>
		<?php 
		if($this->LoginStatus)
		{
			echo "<span class=user>".$Login["login"]["username"]."</span>";
		}
		?><span class=links>
				<a class=alinks href="index.php"> Home </a>-
				<a class=alinks href="?format=rss"> RSS </a>-
				<a class=alinks href="?id=all"> Users </a>-
			</span><?php 
		if($Login["login"]['id'])
		{
			?><a class=alinks href=?logout=1 > Logout </a><?php 
		} 
		else
		{ 
			?> <a href=?login=1>Login</a> <?php 
		} 
		?></span>
		</div><?php
	}
	function fullMsg($data)
	{
		if($data['Active'] != 1 )
		{
			return false;
		}
		$unqid = $data['Tbl_ID'];
		$userid = $data['User_ID'];
		$message = $data['Message'];
		$orgauth = $data['OrgAuth'];
		$time = $data['Time_TS'];
		$rating = $data['Rating'];
		if(!EMPTY($data['Vote_TS']))
		{
			$voted = true;
		}
		else
		{
			$voted = false;
		}
		if(!EMPTY($data['Follow_ID']))
		{
			$userfollows = true;
			$tag = "home";
		}
		if(!EMPTY($data['Reply_ID']))
		{
			$reply = true;
			$tag = "reply";
		}
		if(EMPTY($tag))
		{
			$tag = "everyone";
		}
		
		// First Span
		?><span class='<?php echo $tag ?>'>
			<div class=message>
				"<?php echo $message; ?>"
			</div>
			<span class=info>
				Rating: <?php echo $rating ?><br>
				<span class=byline>
					<a style="color:black;" href="javascript:getAuthor('<?php echo $userid ?>')"><?php echo $orgauth ?></a>
				</span> 
				<span class=time> 
					<?php echo lib::returnTime($time) ?>
				</span>
			</span><?php
			if($voted)
			{
			}
			else
			{	
				?><div id="home<?php echo "_vote". $unqid ?>" class=vote>
					<img id=voteimgup<?php echo $unqid ?> onClick=vote.voteUp('<?php echo $unqid ?>') src='img/uparrow_big.gif'><Br><br>
					<img id=voteimgdown<?php echo $unqid ?> onClick=vote.voteDown('<?php echo $unqid ?>') src='img/downarrow_big.gif'>
					</div>
				<?php
			}
	}
	function condenseMsg($data)
	{
		if($data[Active] != 1 )
		{
			return false;
		}
		$unqid = $data[Tbl_ID];
		$userid = $data[User_ID];
		$message = $data[Message];
		$orgauth = $data[OrgAuth];
		$time = $data[Time_TS];
		$rating = $data[Rating];
		if(!EMPTY($data[Vote_TS]))
		{
			$voted = true;
		}
		if(!EMPTY($data[Follow_ID]))
		{
			$userfollows = true;
			$tag = "home";
		}
		if(!EMPTY($data[Reply_ID]))
		{
			$reply = true;
			$tag = "reply";
		}
		if(EMPTY($tag))
		{
			$tag = "everyone";
		}
		?>
		<span class="smallmessage">
			<div>
				"<?php echo $message; ?>"
			</div>
		</span>
<?php
	}
	public function header()
	{	
		?><html>
			<head>
			<title>Twicha - "Easy Enough"</title>
			<?php
				html::generate_CSSLinks(site::getStylesheets());
				html::generate_JSLinks(site::getJavascript());
			?>
			</head>
			<body><?php
	}
}
?>